feat(skills): source dd-apm sub-skills via agent-skills Cargo git dep (alternative to #530)#536
Open
platinummonkey wants to merge 10 commits into
Open
feat(skills): source dd-apm sub-skills via agent-skills Cargo git dep (alternative to #530)#536platinummonkey wants to merge 10 commits into
platinummonkey wants to merge 10 commits into
Conversation
This comment has been minimized.
This comment has been minimized.
This was referenced Jun 8, 2026
ryanmaclean
pushed a commit
to datadog-labs/agent-skills
that referenced
this pull request
Jun 8, 2026
Adds compile-time constants for every SKILL.md in the repo so downstream crates (e.g. pup) can depend on this as a Cargo git dep and access skill content without git submodules. Pattern matches the expected interface in DataDog/pup#536: - DD_<PRODUCT>_SKILL (&str) for products with a root SKILL.md - DD_<PRODUCT>_SUB_SKILLS (&[(&str, &str)]) for products with sub-skills, where each tuple is (relative_path, content) Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace the submodule approach proposed in #530 with a Cargo path dependency. No .gitmodules, no `submodules: recursive` peppered across every CI checkout step. - crates/agent-skills/: new crate vendoring the 12 dd-apm SKILL.md files from datadog-labs/agent-skills@c447f4d (root router + 11 nested sub-skills under k8s-ssi/, linux-ssi/, service-remapping/) - Cargo.toml: add `agent-skills = { path = "crates/agent-skills" }`; a comment shows how to flip to a git dep once agent-skills ships a Cargo.toml, with no other pup changes needed - src/skills.rs: use agent_skills::DD_APM_SKILL / DD_APM_SUB_SKILLS instead of bare include_str!(); extend install_paths to write nested sub-skill files alongside the root SKILL.md (SkillMd format only); update files field doc; add two new tests for sub-skill install paths https://claude.ai/code/session_01BfYL9qPvktFuLXHNyH3rPB
The previous commit vendored the agent-skills content into a local crates/ directory, which is equivalent to Option 1 (direct copy). This commit corrects that: remove crates/agent-skills/ entirely and point Cargo.toml at the upstream repo directly. Cargo.toml now uses a git dep pinned to the same commit referenced by PR #530, matching the pattern already used for datadog-api-client: agent-skills = { git = "https://github.com/datadog-labs/agent-skills", rev = "c447f4d42f05fa8497c6fa0d1ee3889b7020dce3" } The SKILL.md files stay in the agent-skills repo only. Updating means bumping the rev in Cargo.toml — a single, reviewable line change. This PR requires a companion change to datadog-labs/agent-skills to add a Cargo.toml and src/lib.rs that expose DD_APM_SKILL and DD_APM_SUB_SKILLS as compile-time constants (the same API consumed in src/skills.rs). https://claude.ai/code/session_01BfYL9qPvktFuLXHNyH3rPB
Updates the agent-skills git dep from c447f4d to 05c76987, the commit that initializes the repo as a proper Cargo library. Cargo.lock updated via cargo fetch. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The shallow two-level counter was written when dd-apm had a single SKILL.md. Now that dd-apm ships 12 files (root + 11 sub-skills), use a recursive file counter and assert 15 (12 dd-apm + 3 dd-pup-pi). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
90582eb to
fc35bf7
Compare
- Use unwrap_or_else with path context so panics name the failing dir - Add spot-check for dd-apm/k8s-ssi/agent-install/SKILL.md to verify nested sub-skill paths are preserved (count alone can't catch flattening) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Exact counts are a moving target as agent-skills adds sub-skills. The specific path assertions already verify correctness; the count check just guards against a silent zero-file install. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace >= 1 with a floor derived from agent_skills::DD_APM_SUB_SKILLS.len() so the bound grows automatically as sub-skills are added without re-pinning a magic number. Also add README.md and linux-ssi path existence checks. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
🐑 PR Shepherd is maintaining this PRI watch your PR and automatically fix CI failures, rebase your branch, handle flaky tests, and push it to the merge queue when it's ready. More about what I do → Guide To pause me on this PR, add the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this does
Alternative to #530 that avoids git submodules entirely.
Instead of a
.gitmodulesentry andsubmodules: recursiveon every CI checkout step, this PR treatsdatadog-labs/agent-skillsas a Cargo git dependency — the same pattern already used fordatadog-api-client:src/skills.rsconsumes two constants from the crate:agent_skills::DD_APM_SKILL— the routerSKILL.mdagent_skills::DD_APM_SUB_SKILLS— the 11 nested sub-skill paths + contentpup skills install dd-apmwrites 12 files (root + 11 sub-skills) exactly as in #530, with no change to developer workflow or CI.Why not submodules
git clonewithout--recurse-submodulessilently produces a broken buildsubmodules: recursivegit submodule update --remote+ rebuild rather than a single rev bump inCargo.tomlCargo.lockChanges in this PR (pup side only)
Cargo.tomlagent-skillsgit dep, pinned to revsrc/skills.rsdd-apmentry uses crate constants;install_pathsextended to write nested sub-skill files;filesfield doc updatedsrc/skills.rs(tests)AgentMdformatNo
.gitmodules. No CI changes.Prerequisite: companion PR to agent-skills
This PR is a draft and will not build until
datadog-labs/agent-skillsships aCargo.toml+src/lib.rsexposing:Once that lands, update the
revhere to point at the new commit and mark this PR ready for review.Updating sub-skills going forward
Then
cargo update -p agent-skillsto refreshCargo.lock. No submodule commands, no CI changes.Generated by Claude Code